from langchain.prompts import (
    ChatPromptTemplate,
    HumanMessagePromptTemplate,
    SystemMessagePromptTemplate,
)
from langchain.chat_models import init_chat_model

llm = init_chat_model("deepseek-chat", model_provider="deepseek",
                      api_key="sk-ce4bb9f61a2a4a4da41cf6c0d23c752d")

template = ChatPromptTemplate.from_messages(
    [
        SystemMessagePromptTemplate.from_template("你是{product}的客服助手。你的名字叫{name}"),
        HumanMessagePromptTemplate.from_template("{query}")
    ]
)

prompt = template.format_messages(
    product="积云教育大模型课程",
    name="小积",
    query="你是谁"
)

print(prompt)

ret = llm.invoke(prompt)

print(ret.content)
